|
|
|
|
|
|
|
In Visual Basic 6.0, two controls that greatly simplify your ability to enter dates were added to the second Windows Common controls group. These controls are the MonthView control and the DTPicker control. The MonthView control, pictured in Figure 12.21, is a versatile calendar control that lets users select dates visually rather than enter dates with the keyboard. |
|
|
|
|
|
|
|
|
Figure 12.21
A MonthView control allows your users to select a date
value by looking at a calendar rather than having to type it. |
|
|
|
|
|
|
|
|
Changing the Appearance of the MonthView |
|
|
|
|
|
|
|
|
Figure 12.21 shows the MonthView control as it appears by default. You can use several additional properties to change the initial appearance and behavior of the control, however. Some of them are listed in Tables 12.2 and 12.3. |
|
|
|
|
| Table 12.2 Appearance Properties of the MonthView Control | | Name | Default Value | Description | | ShowToday | True | Controls whether a line appears at the bottom of the calendar indicating the current date. | | ShowWeekNumbers | False | Controls whether a column displaying the week number appears to the left of each month. | | ScrollRate | 1 | Controls how many months the calendar advances or moves back when users click the scroll buttons. Note that even if this property is set to a value higher than 1, users can still move through the months one at a time by clicking the trailing dates at the corners of the MonthView control. | | DayBold ( ) | False | Controls whether the specified date is displayed in bold type. This property is useful if you want to indicate special days on the calendar, such as holidays. To use the property, you must specify a date, as in the following example: MonthView1.DayBold(#7/4/1998#) = True |
|
|
|
|
|
|
The MonthView control allows you to specify colors for each of its individual sections. |
|
|
|
|
|